dxp-ux
POST Prepay-Topup Balance (TMF-654)
The createTopupBalance API provides
Below features for PR:
- createTopupBalance: allows the customer to top up their account with a mobile number that they have specified (MSISDN) or subscriptionId.
- Retrieve Tax Info: API returns the estimated tax amount before making the top-up if we call API with field reason = TAX. Below features for PR:
Below features for PA:
- createTopupBalance: allows the customer to top up their account with a specified MSISDN. The topup can be performed using either voucher or voucherless method.
URL
http://[localhost]:[port]/dxp-ux/v1/{businessId}/topupBalance
URL PARAMS
name | type | description | required |
---|---|---|---|
businessId | string | 2 letter ISO 3166 country code (TT, BB, JM, PA, PR etc.) identifying the business unit. | Y |
Headers
name | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) |
---|---|---|---|
client_id | string | The client_id identifying the channel. Minimum characters: 5 | Y(PR,PA) |
client_secret | string | Password associated with the client_id. Minimum characters: 5 | Y(PR,PA) |
lob | string | The Line of Business Identifier currently available are: FIXED PREPAID POSTPAID | N(PR),N/A(PA) |
channeId | string | Channel to business: Allowed value: APP (SupperApp), Qpay (RT2) | Y(PR),N/A(PA) |
X-Correlation-ID | string | Identifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction. | Y(PR,PA) |
targetSystem | string | This describes the target system. โMatrixxโ is in scope. | Y(PR),N/A(PA) |
Data Model - Request
name | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) |
---|---|---|---|
id | string | The unique order id used in the authorise or settlement request. This can be used to track the transaction and aids duplicate checking. Example : OrderId of the transaction. Should be alpha numeric value without colons (sample: "ABC12345") | Y (PR) , N/A (PA) |
amount | object | Indicate the amount on the bucket | Y (PR , PA) |
amount.amount | number | Unit number, the amount that you are doing recharge to customer | Y (PR, PA) |
amount.units | string | Currency (ISO4217 norm uses 3 letters to define the currency) | N (PR) , Y(PA) |
voucher | string | Identifier for a voucher when the topup can be performed by this means Note for PR: Voucher is mandatory field we should have to any random value or null , to obtain tax details before paying for the topup | Y (PR , PA) |
reason | string | the reason for the action/task Note for PR: The "reason" field it should have to passed as (tax, estimate, tax estimate) and the voucher field is passed as null or random values, to obtain tax details before paying for the topup | Y (PR) , N/A (PA) |
product[] | array of object | A reference to the Product associated with this bucket | Y(PR) , N/A (PA) |
product[].id | string | no significance required field in raml , but we are not passing any value we are passing as empty string | Y(PR) , N/A (PA) |
product[].name | string | Name of the related entity,it is a product name recharge offer name ,it is hardcoded value | Y(PR) , N/A (PA) |
product[].'@type' | string | it is a offer type , it is hardcoded value | Y(PR) , N/A (PA) |
relatedParty[] | array of object | Used to provide information about any other entity with relation to the operation, Please refer below relatedParty Table for more details | Y(PR) , N/A (PA) |
relatedParty[].id | string | Unique identifier of a related entity. | Y(PR) , N/A (PA) |
relatedParty[].'@type' | string | When sub-classing, this defines the sub-class Extensible name | Y(PR) , N/A (PA) |
partyAccount | object | PartyAccount reference. A party account is an arrangement that a party has with an enterprise that provides products to the party. | Y (PR) , N/A(PA) |
partyAccount.id | string | Customer Mobile Number | Y (PR) , N/A(PA) |
partyAccount.'@type' | string | When sub-classing, this defines the sub-class entity name of partyAccount, In this case either MSISDN/SubscriptionId | Y (PR) , N/A (PA) |
bucket | object | link to the resource that holds bucket information | N/A (PR) ,Y(PA) |
bucket.id | string | unique identifier of bucket | N/A (PR) ,Y(PA) |
paymentMethod | object | A payment method defines a specific mean of payment | N/A (PR) ,Y(PA) |
paymentMethod.id | string | Unique id for auditing and identifying duplicate transactions | N/A (PR) ,Y(PA) |
usageType | string | defines the type of the underlying Balance. | N/A (PR) ,Y (PA) |
channel | object | The channel to which the resource reference | N/A (PR) ,Y(PA) |
channel.id | string | unique identifier of the channel | N/A (PR) ,Y(PA) |
channel.name | string | Name of the channel | N/A (PR) ,Y(PA) |
channel.href | string | Hyperlink reference of channel | N/A (PR) ,N(PA) |
product subResource -Data Model
@type | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) | examples |
---|---|---|---|---|
Offer | string | This indicates the offer being applied. | Y(PR) | PR: {"id": "01", "name":"RechargeOffer", "@type": "Offer" } |
relatedParty subResource -Data Model
@type | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) | examples |
---|---|---|---|---|
PaymentGatewayUserId | string | Identifier for the customer id on the payment gateway, "BRAIN TREE". | Y(PR) | PR: {"id": "628935575", "@type": "PaymentGatewayUserId" } |
PaymentGatewayId | string | Identifier for the specific payment gateway. If not supplied, the default payment gateway will be used." | Y(PR) | PR: {"id": "0","@type": "PaymentGatewayId" } |
Data Model Response
name | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) |
---|---|---|---|
id | string | The unique id used in the authorise or settlement request. This can be used to track the transaction and aids duplicate checking | N (PR), Y(PA) |
href | string | A reference to the resource | N/A (PR),Y(PA) |
confirmationDate | datetime | when the deduction was confirmed in the server | N (PR), N/A (PA) |
status | string | Status of the operation | N (PR), Y(PA) |
amount | object | An amount in a given unit | N (PR), Y(PA) |
amount.amount | number | The amount that you are doing recharge to customer | N (PR), Y(PA) |
amount.units | string | Currency (ISO4217 norm uses 3 letters to define the currency) | N (PR), Y(PA) |
voucher | string | After successful Payment, "BRAIN TREE" will send encrypted transaction code/one time code | N (PR), N/A (PA) |
reason | string | Text describing the reason for the action/task | N (PR), Y(PA) |
product[] | array of object | A reference to the Product associated with this bucket | N (PR), N/A (PA) |
product[].id | string | no significance required field in raml , but we are not passing any value we are passing as empty string | N (PR), N/A (PA) |
product[].name | string | Name of the related entity,it is a product name recharge offer name ,it is hardcoded value | N (PR), N/A (PA) |
product[].'@type' | string | It represents is a offer type , it is hardcoded value | N (PR), N/A (PA) |
validFor | object | A period of time, either as a deadline (endDateTime only) a startDateTime only, or both | N (PR), Y(PA) |
validFor.endDateTime | datetime | End of the time period | N (PR), Y(PA) |
validFor.startDateTime | datetime | Start of the time period. If you define a start, you must also define an end | N (PR) |
relatedParty[] | array of object | Used to provide information about any other entity with relation to the operation, Please refer below relatedParty Table for more details | N (PR), N/A (PA) |
relatedParty[].id | string | Unique identifier of a related entity. | N (PR), N/A (PA) |
relatedParty[].'@type' | string | When sub-classing, this defines the sub-class Extensible name | N (PR), N/A (PA) |
bucket | object | link to the resource that holds bucket information | N (PR), Y(PA) |
bucket.id | string | unique identifier Note for PR:Name of the related entity. Identify the account type example :Prepaid | N (PR), Y(PA) |
bucket.href | string | Hyperlink reference of bucket | N/A (PR),Y(PA) |
bucket.name | string | Name of the related entity. | N (PR) , N/A (PA) |
impactedBucket[] | array of object | A resource that references other buckets that have been impacted by the action of type TopupBalance,AdjustBalance,TransferBalance or ReserveBalance Note for PR: Tax information | N (PR) , Y (PA) |
impactedBucket[].amountAfter | number | object | Indicates the amount after on the impacted bucket after the action has completed Note: For PA, this field is object For PR, this field is number and is the total amount that you are paying for topup with Tax includes | N (PR) , Y (PA) |
impactedBucket[].name | string | Name of the impactedBucket. | N (PR) , N/A (PA) |
impactedBucket[].item[] | array of object | Array of items in impactedBucket. | N (PR) , N/A (PA) |
impactedBucket[].item[].amount | integer | Amount paying for STATE SALES TAX and CITY SALES TAX | N (PR) , N/A (PA) |
impactedBucket[].item[].name | string | Name related to STATE SALES TAX and CITY SALES TAX | N (PR) , N/A (PA) |
impactedBucket[].amountAfter.amount | number | Numeric value in a given unit | N/A (PR), Y(PA) |
impactedBucket[].amountAfter.units | string | Unit for the amount | N/A (PR), Y(PA) |
impactedBucket[].amountBefore | object | Indicates the amount remaining on the impacted bucket | N/A (PR), Y(PA) |
impactedBucket[].amountBefore.amount | number | Numeric value in a given unit | N/A (PR), Y(PA) |
impactedBucket[].amountBefore.units | string | Unit for the amount | N/A (PR), Y(PA) |
partyAccount | object | PartyAccount reference. A party account is an arrangement that a party has with an enterprise that provides products to the party. | N (PR) , N/A (PA) |
partyAccount.id | string | Customer Mobile Number | N (PR) , N/A (PA) |
partyAccount.'@type' | string | When sub-classing, this defines the sub-class entity name of partyAccount, In this case either MSISDN/SubscriptionId | N (PR) , N/A (PA) |
channel | object | The channel to which the resource reference to | N/A (PR), Y(PA) |
channel.id | string | unique identifier of channel | N/A (PR), Y(PA) |
channel.href | string | Hyperlink reference | N/A (PR), Y(PA) |
channel.name | string | Name of the channel. | N/A (PR), Y(PA) |
requestedDate | datetime | Date when the deduction request was received in the server | N/A (PR), Y(PA) |
product subResource -Data Model
@type | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) | examples |
---|---|---|---|---|
Offer | string | Recharge Offer | N(PR) | PR: {"id": "01", "name": "RechargeOffer", "@type": "Offer" } |
impactBucket subResource - Data Model
field | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) | examples |
---|---|---|---|---|
amountAfter | number| object | Indicates the amount after on the impacted bucket after the action has completed Note: For PA, this field is object For PR, this field is number and is the total amount that you are paying for topup with Tax includes | N(PR) , Y(PA) | PR: 111.5 PA: {"amount": 1167.55, "units": "USD"} |
amountBefore | object | amount before the topup | N/A (PR), Y(PA) | PA: { "amount": 1161.92, "units": "USD"} |
name | string | name to identify the bucket | N(PR) | PR: "Total Amount" |
item[] | array | A resource used by the ImpactedBucket resource to capture the impact of a ImpactedBucket | N (PR) | PR: [{"amount": 10.5, "name": "STATE SALES TAX" }, {"amount": 1.0, "name": "CITY SALES TAX" }] |
impactedBucket.item subResource -Data Model
name | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) | examples |
---|---|---|---|---|
STATE SALES TAX | string | Amount paying for STATE SALES TAX | N(PR) | PR: { "amount": 10.5, "name": "STATE SALES TAX" } |
CITY SALES TAX | string | Amount paying for CITY SALES TAX | N(PR) | PR: {"amount": 1.0, "name": "CITY SALES TAX" } |
relatedParty subResource -Data Model
@type | value | description | required (mandatory-Y, optional-N, Not applicable- N/A) | example |
---|---|---|---|---|
PaymentGatewayUserId | string | Payment gate way user id; will get this info from "BRAIN TREE". | N(PR) | PR: {"id": "628935575", "@type": "PaymentGatewayUserId" } |
PaymentGatewayId | string | Identifier for the specific payment gateway. If not supplied, the default payment gateway will be used here default gateway is "BRAIN TREE". | N(PR) | PR: {"id": "0","@type": "PaymentGatewayId" } |
PaymentResourceIdRef | string | Payment resource id | N(PR) | PR: { "id": "70", "@type": "PaymentResourceIdRef" } |
Key considerations
- Please refer the examples from the following URL - DXP UX - POST TopUpBalance
PA Implementation
1. This is implemented for prepaid customers.
2. Top-up is done through the Ericsson system and can be performed in two ways:
- Voucher
- Voucherless
3. For voucher-based top-up, the following fields are mandatory in the request:
- bucket.id: This is the service number or MSISDN.
- voucher: A valid voucher must be provided and currently the maximum expected length is 16 characters.
- paymentMethod.id: A unique ID used for auditing and identifying duplicate transactions.
- channel.name, channel.id: Specific to each payment gateway.
- amount: As per RAML, this field is mandatory, so it must be passed as 0.0.
- usageType: This should always be "monetary".
4. For voucherless top-up, the following fields are mandatory in the request:
- bucket.id: This is the service number or MSISDN.
- paymentMethod.id: This should be the transaction ID received after successful payment with the payment gateway.
- channel.name, channel.id: Specific to each payment gateway.
- amount: The amount chosen by the customer.
- usageType: This should always be "monetary".
5. For each top-up, X-correlation-ID and paymentMethod.id should be unique.
6. The voucher field is not applicable for voucherless top-up use case requests.
7. For all the dateTime fields
- Any datetime before 1908-04-22 will show offset -05:18
- Any datetime on or after 1908-04-22 will show offset -05:00
PR Implementation
1. For TAX_INFORMATION Request:
- The possible values of reason attributes are "TAX/ESTIMATE/TAX ESTIMATE"
- No need to pass valid voucher (one time code/nonce) code, it will accept any dummy value.
- id field is not applicable for Tax information using subscriptionId usecase .
- relatedParty array and its fields are not applicable.
2. For TOPUP BALANCE Request:
- No need to pass reason attribute.
- Expecting valid voucher (onetime code/nonce) code for complete top-up balance.
- id , partyAccount.'@type', product array and its fields are optional.
- reason field is not applicable.
3. For TAX_INFORMATION Response:
- "id" field is not applicable for Tax information using subscriptionId usecase .
- "confirmationDate" , relatedParty[] array and its fields are not applicable.
4. For TOPUP BALANCE Response:
- "reason" field is not applicable.
Possible Error Scenarios for PR :
IF WE ARE PASSING INVALID (MSISDN) NUMBER IN REQUEST BODY
{
"errors": [
{
"code": 400,
"message": "MATRIXX:POST_TOPUP_BALANCE",
"description": "11 | Subscriber not found (AccessNumber=709565949)"
}
]
}
IF WE ARE PASSING INVALID VOUCHER IN REQUEST BODY
{
"errors": [
{
"code": 400,
"message": "MATRIXX:POST_TOPUP_BALANCE",
"description": "52 | The AUTHORIZATION_AND_SETTLEMENT Request to Braintree has Failed: Invalid Payment Method Nonce QWEDRFRG"
}
]
}
IF WE ARE PASSING INVALID PAYMENT Gateway ID REQUEST BODY
{
"errors": [
{
"code": 400,
"message": "MATRIXX:POST_TOPUP_BALANCE",
"description": "52 | No Payment Gateway with Id 3 has been configured"
}
]
}